package presstrack
{
	import mx.collections.ArrayCollection;
	
	import org.presstrack.ContactClass;
	
	[RemoteClass(alias="presstrack.PayerClass")]
	
	[Bindable]
	public class PayerClass extends UserClass
	{
		public var mMediumName:String;
		
		public var arCustomerEmail:ArrayCollection;
		public var arCustomerPhone:ArrayCollection;
		public var arCustomerAddress:ArrayCollection;
		public var arCustomerNote:ArrayCollection;
  		
  		public var ar_debt:ArrayCollection;		
  		
		public function PayerClass(user:UserClass = null) 
		{
			if(user != null)
			{
				super.copyFrom(user);				
			}			
			
			arCustomerEmail		= new ArrayCollection();
			arCustomerPhone		= new ArrayCollection();
			arCustomerAddress	= new ArrayCollection();
			arCustomerNote		= new ArrayCollection();
			
			for each (var ob:Object in arContact) 
			{
				var contact:ContactClass = new ContactClass();
				contact.setFromObject(ob);
				if (contact.type == 1)
				{
					arCustomerEmail.addItem(contact);
				}
				else if (contact.type == 2)
				{
					arCustomerPhone.addItem(contact);
				}
				else if (contact.type == 3)
				{
					arCustomerAddress.addItem(contact);
				}
				else if (contact.type == 4)
				{
					arCustomerNote.addItem(contact);
				}
			}
		}			
	}
}